import java.security.Permission;

/**
 * @Description 默认安全管理器
 * @Author HeavenDirt
 * @Date 2024/7/27 15:44
 */
public class MySecurityManager extends SecurityManager {

    //检查所有权限
    @Override
    public void checkPermission(Permission perm) {
        /*super.checkPermission(perm);*/
    }

    //检查执行权限
    @Override
    public void checkExec(String cmd) {
        throw new SecurityException("checkExec权限异常" + cmd);
    }

    //检查读权限
    @Override
    public void checkRead(String file) {
        //throw new SecurityException("checkRead权限异常" + file);
    }

    //检查写权限
    @Override
    public void checkWrite(String file) {
        //throw new SecurityException("checkWrite权限异常" + file);
    }

    //检查删除权限
    @Override
    public void checkDelete(String file) {
        //throw new SecurityException("checkDelete权限异常" + file);
    }

    //检查网络连接权限
    @Override
    public void checkConnect(String host, int port) {
        //throw new SecurityException("checkConnect权限异常" + host + ":" + port);
    }
}
